package lab02.test11;

/**
 * Created by Administrator on 2017/10/24.
 */
public class Square extends Rectangle {
    //行为：求对角线
    double diagonal(){return (Math.sqrt(longth*longth+width*width));}



    @Override
    public void printMyWay() {
        System.out.println(longth);
        System.out.println(width);
        System.out.println(area());
        System.out.println(perimeter());
        System.out.println(diagonal());
    }

}

